cmake_minimum_required(VERSION 2.8)
SET(IN_OPENWRT $ENV{IN_OPENWRT}) 
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-but-set-variable")

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-but-set-variable -DDEBUG")
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")

if(IN_OPENWRT)
	ADD_SUBDIRECTORY(ap)
else(IN_OPENWRT)
	ADD_SUBDIRECTORY(ac)
endif(IN_OPENWRT)

if(NOT IN_OPENWRT AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
	ADD_SUBDIRECTORY(ap)
endif(NOT IN_OPENWRT AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
